import Vue from 'vue'
import VueRouter from 'vue-router'
import PATH from './router_path'
Vue.use(VueRouter)

// Vue.prototype.$path = PATH
const routes = [

  {
    path: PATH.HOME,
    redirect: '/index'
  },

  {
    path: PATH.INDEX,
    name: 'index',
    component: () => import('../views/pages/index.vue'),
    meta: {
      isShowNavbar: true
    }
  },

  {
    path: PATH.LIST,
    name: 'list',
    component: () => import('../views/pages/list.vue'),
    meta: {
      isShowNavbar: true
    }
  },

  {
    path: PATH.PERSON,
    name: 'person',
    component: () => import('../views/pages/person.vue'),
    meta: {
      isShowNavbar: true
    }
  },
  {
    path: PATH.SHOPCAR,
    name: 'shopcar',
    component: () => import('../views/pages/shopcar.vue'),
    meta: {
      isShowNavbar: true
    }
  },

  {
    path: PATH.LOGIN,
    name: 'login',
    component: () => import('../views/user/login.vue')
  },
  {
    path: PATH.REG,
    name: 'reg',
    component: () => import('../views/user/reg.vue')
  },
  {
    path: PATH.BARGAINLIST,
    name: 'bargainlist',
    component: () => import('../views/index/bargainlist.vue')
  },
  {
    path: PATH.BARGAIN_LIST_DETAILS,
    name: 'bargain_list_details',
    component: () => import('../views/index/bargain_list_details.vue')
  },
  {
    path: PATH.SUBJECTLIST,
    name: 'subjectlist',
    component: () => import('../views/index/subjectlist.vue')
  },
  {
    path: PATH.SUBJECT_LIST_DETAILS,
    name: 'subject_list_details',
    component: () => import('../views/index/subject_list_details.vue')
  },
  {
    path: PATH.RECOMMEND,
    name: 'recommend',
    component: () => import('../views/index/recommend.vue')
  },

  {
    path: PATH.RECOMMEND_LIST,
    name: 'recommend_list',
    component: () => import('../views/index/recommend_list.vue')
  },

  {
    path: PATH.SIGN,
    name: 'sign',
    component: () => import('../views/index/sign.vue')
  },

  {
    path: PATH.COUPON,
    name: 'coupon',
    component: () => import('../views/index/coupon.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router